from commen.opyxl import FileHanlder

f1 = FileHanlder()
data1 = f1.read_excel('commen/data.xlsx','主题首页')
print(data1)
data2 = ','.join(data1[0])
print(data2)

import pytest
import requests
#自动写入文件操作！！！！！！！
@pytest.mark.parametrize(data2,data1[1:])
def test_ddt_excel(TCNo,TEST_POINT,Automation,test_type,tc_owner,E_resDesc,E_resCode,Method,URL,page,tab,limit,mdrender):
    data = {
        'page':page,
        'tab':tab,
        'limit':limit,
        'mderender':mdrender
    }
    if Method.lower() == 'get':
        r = requests.get(url=URL,params = data)
        assert r.status_code == E_resCode

        E_resDesc = r.text
        print('======', TCNo + 1, data1[0].index('E_resDesc') + 1, E_resDesc)
        f1.write_excel('commen/data.xlsx','主题首页',TCNo+1, data1[0].index('E_resDesc')+1, E_resDesc)